﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using NorthWin_Test.Utils;
using System.Data;



namespace NorthWin_Test.Dao
{
    public class BaseDao
    {
        public SqlConnection Conn = new SqlConnection(" Data Source=DH-F58EC8761D1A\\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True");
        
        //public SqlConnection GetConfigConnection()
        //{
        //    string strconn = ConfigurationSettings.AppSettings[Constants.ConfigKey.ConnectionKey];
        //    SqlConnection conn = new SqlConnection(strconn);
        //    return conn;
        //}
        
        public DataTable GetData(SqlCommand command)
        {
            command.Connection = Conn;
            SqlDataAdapter dad = new SqlDataAdapter(command);
            DataTable table = new DataTable();
            dad.Fill(table);
            return table;
        }
    }
}
